<%--
  Created by IntelliJ IDEA.
  User: zhaoyang
  Date: 2020/8/3
  Time: 5:33 下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%--<%@include file="../checkLogin.jsp"%>--%>

<html>
<head>

    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>学校管理系统</title>
    <link rel="icon"
          href="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1596120245889&di=5093bcb814a73039583d935c56ee7213&imgtype=0&src=http%3A%2F%2Fen.pimg.jp%2F041%2F867%2F367%2F1%2F41867367.jpg"/>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">

    <!-- 页面头部引用 -->
    <%@include file="../pageHeadLink.jsp"%>
    <!-- 页面头部引用 /-->
</head>

<body class="hold-transition skin-purple sidebar-mini">

<div class="wrapper">

    <!-- 页面头部 -->
    <%@include file="../pageHead.jsp"%>
    <!-- 页面头部 /-->

    <!-- 导航侧栏 -->
    <%@include file="../pageLeft.jsp"%>
    <!-- 导航侧栏 /-->

    <!-- 内容区域 -->
    <!-- @@master = admin-layout.html-->
    <!-- @@block = content -->

    <div class="content-wrapper">

        <!-- 内容头部 -->
        <section class="content-header">
            <h1>
                年级信息管理
                <small>查看年级信息</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>首页</a></li>
                <li><a href="#">年级信息管理</a></li>
                <li class="active">查看年级信息</li>
            </ol>
        </section>
        <!-- 内容头部 /-->

        <!-- 正文区域 -->
        <section class="content">

            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">欢迎登陆学校信息后台管理系统</h3>
                </div>

                <div class="box-body">

                    您可以在这里查看年级信息<br> 如果需要帮助的话请点击侧边栏下方的帮助文档

                </div>
                <!--查看信息-->
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">查看年级信息</h3>
                    </div>
                    <!-- .box-body -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">列表</h3>
                        </div>

                        <div class="box-body">

                            <!-- 数据表格 -->
                            <div class="table-box">

                                <!--工具栏-->
                                <div class="pull-left">
                                    <div class="form-group form-inline">
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-default" title="新建"><i
                                                    class="fa fa-file-o"></i> 新建
                                            </button>
                                            <button type="button" class="btn btn-default" title="删除"><i
                                                    class="fa fa-trash-o"></i> 删除
                                            </button>

                                            <button type="button" class="btn btn-default" title="开启"><i
                                                    class="fa fa-check"></i> 开启
                                            </button>
                                            <button type="button" class="btn btn-default" title="屏蔽"><i
                                                    class="fa fa-ban"></i> 屏蔽
                                            </button>
                                            <button type="button" class="btn btn-default" title="刷新"><i
                                                    class="fa fa-refresh"></i> 刷新
                                            </button>
                                        </div>
                                    </div>
                                </div>

                                <%--                                <!-- 下拉输入 -->--%>
                                <%--                                <div class="input-group margin" style="margin-left: 800px">--%>
                                <%--                                    <div class="input-group-btn">--%>
                                <%--                                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">搜索属性--%>
                                <%--                                            <span class="fa fa-caret-down"></span></button>--%>
                                <%--                                        <ul class="dropdown-menu">--%>
                                <%--                                            <li><a href="#">姓名</a></li>--%>
                                <%--                                            <li><a href="#">性别</a></li>--%>
                                <%--                                            <li><a href="#">电话</a></li>--%>
                                <%--                                            <li><a href="#">QQ</a></li>--%>
                                <%--                                            <li><a href="#">微信</a></li>--%>
                                <%--                                            <li><a href="#">住址</a></li>--%>
                                <%--&lt;%&ndash;                                            <li class="divider"></li>&ndash;%&gt;--%>
                                <%--                                        </ul>--%>
                                <%--                                    </div>--%>
                                <%--                                    <!-- /btn-group -->--%>
                                <%--                                    <input type="text" class="form-control" style="width: 135px" placeholder="请输入搜索内容">--%>
                                <%--                                    <span class="glyphicon glyphicon-search form-control-feedback" ></span>--%>
                                <%--                                </div>--%>
                                <%--                                <!-- /下拉输入 -->--%>


                                <%--                                <div class="box-tools pull-right">--%>
                                <%--                                    <div class="has-feedback">--%>
                                <%--                                        <input type="text" class="form-control input-sm" placeholder="搜索">--%>
                                <%--                                        <span class="glyphicon glyphicon-search form-control-feedback"></span>--%>
                                <%--                                    </div>--%>
                                <%--                                </div>--%>
                                <div class="input-group input-group-sm" style="float: right">
<%--                                    <form method="get" action="s_studentInfo.jsp">--%>
                                    <form method="post" action="${basePath}/doStudentInfoServlet">
                                        <input type="text" class="form-control " style="width: 100px;"
                                               placeholder="请输入姓名" name="sname" value="${sname}">
                                        <input type="text" class="form-control " style="width: 100px;"
                                               placeholder="请输入电话" name="telephone" value="${telephone}">
                                        <span class="input-group-btn">
                                                <button type="submit" class="btn btn-info btn-flat">搜索</button>
                                             </span>
                                    </form>
                                </div>

                                <!--工具栏/-->


                                <!--数据列表-->
                                <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                                    <thead>
                                    <tr>
                                        <th class="" style="padding-right:0px;">
                                            <input id="selall" type="checkbox" class="icheckbox_square-blue">
                                        </th>
                                        <th>学号</th>
                                        <th>姓名</th>
                                        <th>性别</th>
                                        <th>电话</th>
                                        <th>QQ</th>
                                        <th>微信</th>
                                        <th>年级</th>
                                        <th>入学日期</th>
                                        <th>城市</th>
                                        <th>生日</th>
                                        <th>地址</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${stuLists}" var="stu" varStatus="s">
                                    <tr>
                                        <td><input name="ids" type="checkbox"></td>
                                        <td>${stu.stuno}
                                        </td>
                                        <td>${stu.sname}
                                        </td>
                                        <td>${stu.sex}
                                        </td>
                                        <td>${stu.telephone}
                                        </td>
                                        <td>${stu.qq}
                                        </td>
                                        <td>${stu.wechat}
                                        </td>
                                        <td>${stu.gradeid}
                                        </td>
                                        <td>${stu.enterdate}
                                        </td>
                                        <td>${stu.fromcity}
                                        </td>
                                        <td>${stu.birthday}
                                        </td>
                                        <td>${stu.address}
                                        </td>


                                        <td class="text-center">
                                            <a href="${basePath}/toUpdateStudentServlet?stuno=${stu.stuno}">
                                                <button type="button" class="btn bg-olive btn-xs">修改</button>
                                            </a>
                                            <a href="#">
                                                <button type="button" class="btn bg-olive btn-xs"
                                                        onclick="doDel('${stu.sname}',${stu.stuno});return false;">删除
                                                </button>
                                            </a>

                                            <a href="${basePath}/doStudentInfoShowServlet?stuno=${stu.stuno}">
                                                <button type="button" class="btn bg-olive btn-xs">查看</button>
                                            </a>
                                        </td>
                                        </c:forEach>
                                    </tr>
                                    </tbody>
                                    <!--
                                <tfoot>
                                <tr>
                                <th>Rendering engine</th>
                                <th>Browser</th>
                                <th>Platform(s)</th>
                                <th>Engine version</th>
                                <th>CSS grade</th>
                                </tr>
                                </tfoot>-->
                                </table>
                                <!--数据列表/-->


                            </div>
                            <!-- 数据表格 /-->


                        </div>
                        <!-- /.box-body -->

                        <!-- .box-footer-->
                        <div class="box-footer">
                            <div class="pull-left">
                                <h3>${pageNo}=>>${pageSize}</h3>
                                <div class="form-group form-inline">
                                    总共${pageNum}页，共${pageTotal}条数据。 每页显示
                                    <select class="form-control" id="pageNum" onchange="pageNumChange()">
                                        <c:forEach  var="i" begin="10" step="10" end="50" varStatus="num">
                                            <c:if test="${i==pageSize}" var="check">
                                                <option value="${i}" selected>${i}</option>
                                            </c:if>
                                            <c:if test="${!check}">
                                                <option value="${i}">${i}</option>
                                            </c:if>
                                        </c:forEach>
                                    </select> 条
                                </div>
                            </div>


                            <div class="box-tools pull-right">
                                <ul class="pagination">
                                    <li>
                                        <a href="${basePath}/doStudentInfoServlet?pageNo=1&pageSize=${pageSize}&sname=${sname}&telephone=${telephone}"
                                           aria-label="Previous">首页</a></li>
                                    <c:if test="${pageNo>1}">
                                    <li>
                                        <a href="${basePath}/WdoStudentInfoServlet?pageNo=${pageNo-1}&pageSize=${pageSize}&sname=${sname}&telephone=${telephone}">上一页</a>
                                    </li>
                                    </c:if>
                                        <c:forEach var="i" begin="1" end="${pageNum}">
                                    <li>
                                        <a href="${basePath}/doStudentInfoServlet?pageNo=${i}&pageSize=${pageSize}&sname=${sname}&telephone=${telephone}">${i}
                                        </a></li>
                                        </c:forEach>

                                    <c:if test="${pageNo<pageNum}">
                                    <li>
                                        <a href="${basePath}/doStudentInfoServlet?pageNo=${pageNo+1}&pageSize=${pageSize}&sname=${sname}&telephone=${telephone}">下一页</a>
                                    </li>
                                    </c:if>

                                    <li><input type="number" min="1" max="${pageTotal}" value="${pageNo}"
                                               style="width:35px;height:33px;border:0.3px solid lightgrey"
                                               placeholder="页数"
                                               onkeydown="if(event.keyCode==13) {window.location='${basePath}/doStudentInfoServlet?pageNo='+this.value; doane(event);}&pageSize=${pageSize}&sname=${sname}&telephone=${telephone}">
                                        /${pageNum}跳转
                                    </li>


                                    <li>
                                        <a href="${basePath}/doStudentInfoServlet?pageNo=${pageNum}&pageSize=${pageSize}&sname=${sname}&telephone=${telephone}"
                                           aria-label="Next">尾页</a></li>
                                </ul>

                            </div>

                        </div>
                        <!-- /.box-footer-->
                    </div>
                </div>

            </div>

        </section>
        <!-- 正文区域 /-->

    </div>
    <!-- @@close -->
    <!-- 内容区域 /-->

    <!-- 底部导航 -->
    <%@include file="../pageBottom.jsp"%>
    <!-- 底部导航 /-->

</div>
<!-- 页面尾部引用 -->
<%@include file="../pageBottomLink.jsp"%>
<!-- 页面尾部引用 /-->

<script>
    function doDel(name,id) {
        if (confirm("是否确认删除[" +id+"-"+name + "]？")) {
            location.href = "${basePath}/WEB-INF/AdminLTEdemo01/s_student/doDelStudent.jsp?stuno="+id;
        }
    }

    <%--自定义每页行数--%>

    function pageNumChange() {
        let p = document.getElementById("pageNum");

        let pageN = parseInt(p.options[p.selectedIndex].value);
        location.href = "${basePath}/doStudentInfoServlet?pageSize=" + pageN;
    }

    $(document).ready(function () {

        // 选择框
        $(".select2").select2();

        // WYSIHTML5编辑器
        $(".textarea").wysihtml5({
            locale: 'zh-CN'
        });
    });


    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }

    // 翻页
    $(function () {
        $("#example1").DataTable();
        $('#example2').DataTable({
            "paging": true,
            "lengthChange": false,
            "searching": false,
            "ordering": true,
            "info": true,
            "autoWidth": false
        });
    });

    $(document).ready(function () {
        setSidebarActive("stuInfo");
    });
</script>
</body>

</html>
